#include <stdio.h>
char week[7][20] = {"周一", "周二", "周三", "周四", "周五", "周六", "周日"};
int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main()
{
    /* 求星期几 */
    int year, month, day;
    scanf("%d,%d,%d", &year, &month, &day);
    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
    {
        /* code */
        a[1] = 29;
    }

    int days = day;
    for (int i = 1; i < month; i++)
    {
        days += a[i - 1];
    }
    int weeks = (year-1+(year-1)/4-(year-1)/100+(year-1)/400 + days) % 7;
    printf("%s", week[weeks - 1]);
    return 0;
}
